package views;

import model.Problem;
import model.Solution;
import util.Importer;
import util.SolutionImporter;

public class TestApp {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TestApp app = new TestApp();
		app.launch2();
	}

	public void launch1() {
		Importer importer = new Importer("datasets//model_a1_1.txt");
		importer.readData();
		Problem problem = importer.getProblem();
		problem.printDetails();
		SolutionImporter solutionImporter = new SolutionImporter(problem);
		solutionImporter.setSolutionFileName("solutions//assignment_a1_1.txt");
		solutionImporter.readData();
		Solution solution = solutionImporter.getSolution();
		System.out.println(solution);
		if (solution.isFeasible()) {
			System.out.println("Solution is feasible");
		} else {
			System.out.println("Solution is not feasible");
		}
	}

	public void launch2() {
		Importer importer = new Importer("datasets//model_a1_5.txt");
		importer.readData();
		Problem problem = importer.getProblem();
		problem.printDetails();
		SolutionImporter solutionImporter = new SolutionImporter(problem);
		solutionImporter.setSolutionFileName("solutions//assignment_a1_5.txt");
		solutionImporter.readData();
		Solution solution = solutionImporter.getSolution();
		System.out.println(solution);
		if (solution.isFeasible()) {
			System.out.println("Solution is feasible");
		} else {
			System.out.println("Solution is not feasible");
		}
	}
}
